<?php
// .-----------------------------------------------------------------------------------
// | WE TRY THE BEST WAY 杭州博也网络科技有限公司
// |-----------------------------------------------------------------------------------
// | Author: 会吃草的鱼<783188184@qq.com>
// | Copyright (c) 2013-2016, http://www.itboye.com. All Rights Reserved.
// |-----------------------------------------------------------------------------------

namespace Home\Controller;
use Admin\Api\DatatreeApi;
use Shop\Controller\ArticleController;
use Think\Controller;
use Weixin\Api\WxuserApi;
use Shop\Api\ArticleApi;
class PsController extends HomeController {
    /*
     * 主页余额
     * */
    public function index() {

        $this->display();
    }

    /*
         * 文章列表
         * */
    public function titlelist() {
        $type=I('type',6153);
        $m['parentid']=$type;
        //查询出此菜单下的栏目
        $list=apiCall(DatatreeApi::QUERY_NO_PAGING,array($m));
        if(empty($list['info'])){
            //如果此菜单下没有栏目
            $this->display();
        }else{
            foreach($list['info'] as $k =>$v){
                $map['type']=$v['id'];
                $result=apiCall(ArticleApi::QUERY_NO_PAGING,array($map));
                if(!$result) $this->error("获取错误");
                $tem[$k]['article']=$result['info'];
                $tem[$k]['fenlei']=$v;
            }
            $this->assign('data',$tem);
            $this->display();

        }


    }





}
